<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Grid布局</title>
    <style>
        .parent {
            width: 400px;
            height: 400px;
            margin: 50px auto;
            background-color: cyan;

            display: grid;

            grid-template-rows: 40px 1fr 40px;
            grid-template-columns: 80px 1fr 80px;

            /* 命名网格区域 + 占位与省略 */
            /* 若已经填充到正确位置上，父容器中：中间可用【.】占位，子项中：只需要写头、尾，中间可省略 */
            grid-template-areas:
                'header header header'
                '. . .'
                'footer footer footer';
        }

        .item01 {
            /* grid-area: header; */

            /* 名称是默认的，直接用 */
            /* grid-area: header-start / header-start / header-end / header-end; */
            /* 简写 */
            grid-area: header-start / span 3;

            background-color: red;
        }

        .item02 {
            background-color: orange;
        }

        .item03 {
            background-color: yellow;
        }

        .item04 {
            background-color: green;
        }

        .item05 {
            grid-area: footer;
            background-color: blue;
        }
    </style>
</head>

<body>

    <div class="parent">
        <div class="child item01">1</div>
        <div class="child item02">2</div>
        <div class="child item03">3</div>
        <div class="child item04">4</div>
        <div class="child item05">5</div>
    </div>

</body>

</html>